package com.yuanfengPlus.purchase.controller;



import com.yuanfengPlus.purchase.entity.PurchaseOrder;
import com.yuanfengPlus.purchase.service.IPurchaseOrderService;
import com.yuanfengPlus.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping(value = "/purchaseOrder")
public class PurchaseOrderController {
    @Autowired
    public IPurchaseOrderService iops;
    @GetMapping("/queryPurchaseOrder")
    public Result<List<PurchaseOrder>> queryPurchaseOrder(@RequestBody Map<String, Object> params){
        return iops.queryPurchaseOrder(params);
    }
    @PostMapping("/addPurchaseOrder")
    public Result<String> addPurchaseOrder(@RequestBody PurchaseOrder purchaseOrder){
        return iops.addPurchaseOrder(purchaseOrder);
    }
    @PostMapping("/deletePurchaseOrder")
    public Result<String> deletePurchaseOrder(String purchase_order_id){
        return iops.deletePurchaseOrder(purchase_order_id);
    }
    @GetMapping("/queryPurchaseOrderById")
    public Result<PurchaseOrder> queryPurchaseOrderById(@RequestBody String purchase_order_id){
        return iops.queryPurchaseOrderById(purchase_order_id);
    }
    @PostMapping("/updatePurchaseOrderById")
    public Result<String> updatePurchaseOrderById(@RequestBody PurchaseOrder purchaseOrder){
        return iops.updatePurchaseOrderById(purchaseOrder);
    }
    @PostMapping("/updatePurchaseOrderAgree")
    public Result<String> updatePurchaseOrderAgree(String purchase_order_id){
        System.out.println(purchase_order_id);
        return iops.updatePurchaseOrderAgree(purchase_order_id);
    }
    @PostMapping("/updatePurchaseOrderRefuse")
    public Result<String> updatePurchaseOrderRefuse(String purchase_order_id){
        System.out.println(purchase_order_id);
        return iops.updatePurchaseOrderRefuse(purchase_order_id);
    }

}
